package com.mayn.job;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.mayn.jst.erp.action.SycmDarAction;

/**
 * 生意参谋单品服务分析Job抓取类
 * @author 梁志渊
 * @version 
 * 版本号：【100-000-000】<br/>
 * 创建日期：:2017年7月4日 <br/>
 * 历史修订：<br/>
 */
public class GetAllSycmDarDataJob implements Job{
	private static final Logger LOG = LoggerFactory.getLogger(GetAllSycmDarDataJob.class);
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		long starTime = System.currentTimeMillis();
		LOG.info("JobStart--开始执行");

//		Date currTime = new Date();//当前时间
		Date currTime =  new Date(new Date().getTime()-24*60*60*1000);//前一天
		try {
			//生意参谋_单品服务分析
			LOG.info("dsr--开始执行");
			SycmDarAction.dsr(currTime);
			LOG.info("dsr--执行结束");
			
			//生意参谋_重点服务指标
			LOG.info("dsr_dar--开始执行");
			SycmDarAction.dsr_dar(currTime);
			LOG.info("dsr_dar--执行结束");
		} catch (Exception e) {
			e.printStackTrace();
		}

		long endTime = System.currentTimeMillis();
		long Time = endTime - starTime;
		LOG.info("JobEnd--执行结束,耗时" + Time / 1000 + "秒");
		
	}

}
